package com.gw.smscheck.service.business.tools.impl;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.gw.smscheck.dao.business.tools.ToolsMapper;
import com.gw.smscheck.entity.business.tools.Tools;
import com.gw.smscheck.entity.sys.Log;
import com.gw.smscheck.service.business.tools.ToolsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ToolsServiceimpl implements ToolsService {

    @Autowired
    private ToolsMapper toolsMapper;
    /**
     * 手机号查询省份证号
     * @param dto
     * @return
     */

    @Override
    public PageInfo<Tools> findByPhone(Tools dto) {

        PageHelper.startPage(dto.getPage(), dto.getRows(), "user_id desc");// 排序
        List<Tools> resultList = toolsMapper.findByPhone(dto);
        PageInfo<Tools> pageInfo = new PageInfo<>(resultList);
        return pageInfo;
    }
    /**
     * 身份证号查询手机号
     * @param dto
     * @return
     */
    @Override
    public PageInfo<Tools> findByUserId(Tools dto) {

        PageHelper.startPage(dto.getPage(), dto.getRows(), "user_id desc");// 排序
        List<Tools> resultList = toolsMapper.findByUserId(dto);
        PageInfo<Tools> pageInfo = new PageInfo<>(resultList);
        return pageInfo;
    }

    /**
     * 手机串号查询身份证与手机
     * @param dto
     * @return
     */

    @Override
    public PageInfo<Tools> findByImei(Tools dto) {

        PageHelper.startPage(dto.getPage(), dto.getRows(), "user_id desc");// 排序
        List<Tools> resultList = toolsMapper.findByImei(dto);
        PageInfo<Tools> pageInfo = new PageInfo<>(resultList);
        return pageInfo;
    }

}
